# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Ignacio Taranto <ignacio_taranto@protonmail.com>
# Contributor: Eric Engestrom <aur [at] engestrom [dot] ch>
# Contributor: Kenny Levinsen <aur [at] kl [dot] wtf>

pkgname=greetd-gtkgreet
_pkgname=${pkgname#*-}
pkgver=0.8
pkgrel=1
pkgdesc='GTK based greeter for greetd'
arch=(loong64 x86_64)
url="https://git.sr.ht/~kennylevinsen/$_pkgname"
license=(GPL3)
depends=(json-c
         gtk-layer-shell
         gtk3)
makedepends=(meson
             ninja
             scdoc)
_archive="$_pkgname-$pkgver"
source=("$_archive.tar.gz::$url/archive/$pkgver.tar.gz"
        "$pkgname-fix-build.patch")
sha256sums=('e5c70219da191a60e2e009412603e05c36cee15bbbf7657dbbeaa1d21a692873'
            '2bd9cb623961d1885e3857b688324cdf68b4dfedeb987edf3680ddf50d8dae41')

prepare() {
	cd "$_archive"
	patch -Np0 -i "../${source[1]}"
	mkdir -p build
}

build() {
	arch-meson "$_archive" build -D layershell=enabled
	ninja -C build
}

package() {
	DESTDIR="$pkgdir" ninja -C build install
}
